package com.dao;

import com.entity.Items;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import java.util.List;

/**
 * @author james-CAO
 * @title: ItemsDao
 * @projectName csm_emall_ssm
 * @description: 项目描述
 * @date 2020/10/14 12:07
 */
public interface ItemsDao {

    @Select("select * from items where order_id=#{orderId}")
    public List<Items> selectList(int orderId);

    @Insert("insert into items (price,amount,order_id,good_id) values (#{price},#{amount},#{orderId},#{goodId})")
    @SelectKey(keyProperty = "id" , statement = "SELECT LAST_INSERT_ID()",before = false,resultType = Integer.class)
    public boolean insert(Items items);









}
